package com.xbongbong.paas.field;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * @author: wufeng
 * @date: 2018/8/15 10:12
 * @desrcption: 关联表字段，属性保持和FieldAttrEntity一致
 * @see FieldAttrEntity
 */
@Getter
@Setter
@ToString
public class LinkedAttrPoJo implements Serializable {

    private static final long serialVersionUID = -1896026027409434720L;


    private String attr;

    private String saasAttr;

    private String parentAttr;

    private Integer fieldType;

    private String attrName;

    /**
     * 是否允许编辑 1：允许 0：不允许
     */
    private Integer editable;
    /**
     * 是否允许可见 1:允许 0：不允许
     */
    private Integer visible;

    private String dateType;

    private Integer comboType;

    private List<ItemPoJo> items;

    /**
     * 子表单字段
     */
    private SubFormPoJo subForm;

    /**
     * 子表单列宽
     */
    private Long theWidth;

    /**
     * 宽度规格
     */
    private String widthAttr;

    /**
     * 冻结列的个数
     */
    private Long freezeCount;

    /**
     * 是否冻结
     */
    private Boolean fixed;

    /**
     * 标题的英文
     */
    private String attrNameEn;


//    public String getAttrName() {
//        Locale locale = LocaleContextHolder.getLocale();
//        if (Objects.equals(locale.getLanguage(), I18nStringConstant.ENGLISH_LANGUAGE)&& StringUtils.isNotEmpty(attrNameEn)) {
//            return attrNameEn;
//        }
//        return attrName;
//    }
//    public String getAttrNameEn() {
//        Locale locale = LocaleContextHolder.getLocale();
//        if (Objects.equals(locale.getLanguage(), I18nStringConstant.ENGLISH_LANGUAGE)) {
//            return attrName;
//        }
//        return attrNameEn;
//    }

    /**
     * 字段最小允许的列宽
     */
    private Integer minColumnWidth;

    /**
     * 字段当前列宽
     */
    private Integer columnWidth;
}
